<template>
  <div>
    <h2>专业列表</h2>
    <table>
      <tr>
        <td>id</td>
        <td>名称</td>
        <td>状态</td>
        <td>课程</td>
        <td>操作</td>
      </tr>
      <tr v-for="i in professionals" :key="i.id">
        <td>{{i.id}}</td>
        <td>{{i.name}}</td>
        <td>{{i.status}}</td>
        <td>xxxxx</td>
        <td>
          <button>编辑</button>
          <button>删除</button>
        </td>
      </tr>
    </table>
    <button v-if="previous">上一页</button>
    <button v-for="i in page" :key="i">{{i}}</button>
    <button v-if="next">下一页</button>
  </div>
</template>

<script>
export default {
  data(){
    return{
      professionals:[],
      page:[],
      p:1,
      previous:false,
      next:false
    }
  },
  mounted(){
    this.axios({
      url:'http://127.0.0.1:8000/zhuanye/',
      method:'get',
      params:{'p':this.p}
    }).then(res=>{
      this.professionals=res.data.data;
    })
  }
}
</script>

<style>

</style>
